<%@ page contentType="text/html;charset=UTF-8"  %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<div id="regright">

<html:form action="register/registeraction">
<input type="hidden" name="steptype" value="2"/>
<table>
  <tr>
    <td class="textright"> 主联系人：</td>
    <td><html:text property="contactname"  maxlength="50" size="38" onblur="onblurdo(this)" value="${message.contactname}">
    </html:text>
      <span class="f-12-F60000">*</span></td>
    </tr>
  <tr>
    <td class="textright"> 主联系人手机：</td>
    <td><html:text property="phone1"  maxlength="30" size="38" onblur="onblurdo(this)" value="${message.phone1}">
    </html:text>
      <span class="f-12-F60000">*</span></td>
    </tr>
  <tr>
    <td class="textright"> 电子邮箱：</td>
    <td><html:text property="email"  maxlength="50" size="38"  value="${message.email}" onblur="onblurdo(this)">
    </html:text> <span class="f-12-F60000">   
     *<font color="red" size="1px">请提供公司内部个人邮箱，如无请提供外部个人邮箱</font></span></td>
  </tr>
  <tr>
    <td class="textright"> 公司网址：</td>
    <td> <html:text property="w_address"  maxlength="128" size="38" value="${message.w_address}"></html:text></td>
  </tr>
  <tr>
    <td class="textright"> 通信地址：</td>
    <td> <html:text property="postaddress"  maxlength="128" size="38" value="${message.postaddress}"></html:text></td>
  </tr>
  <tr>
    <td class="textright">邮政编码：</td>
    <td><html:text property="postcode" onkeypress="return event.keyCode>=48&&event.keyCode<=57||event.keyCode==46" style='ime-mode:Disabled;' maxlength="6" size="38" value="${message.postcode}">
    </html:text></td>
  </tr>
  <tr>
    <td class="textright">传真：</td>
    <td><html:text property="fax"  maxlength="30" size="38" value="${message.fax}">
    </html:text></td>
  </tr>
  <tr>
    <td class="textright">供应商描述：</td>
    <td> <html:text property="memo"  maxlength="1024" size="50" value="${message.memo}"></html:text></td>
  </tr>
  <tr>
    <td class="textright">招行联系人：</td>
    <td> <html:text property="z_contact"  maxlength="1024" size="50" value="${message.z_contact}"></html:text></td>
  </tr>
  <tr>
    <td colspan="2" class="f-12-F60000">提示：带“*”的为必填信息；若界面显示不全面，请先设置IE浏览器到兼容性视图，具体操作请见首页相关操作手册。</td>
    </tr>
  <tr>
    <td colspan="2" class="center">
    
    <img style="cursor:hand" src="../images/up.jpg" width="60" height="20" onclick="up(1)"/>&nbsp;&nbsp;<img src="../images/next.jpg" style="cursor:hand" width="60" height="20" border="0" onclick="clicksubmit()"/>
    &nbsp;&nbsp;<img src="../images/reset.jpg" style="cursor:hand" width="60" height="20" onclick="reset()" /></td>
    </tr>
</table>
</html:form>
</div>

<script language="javascript">

function up(index)
{
	window.location.href = "/portal/register/registeraction.do?uptype="+index;
}
	function reset()
	{
		document.registerForm.reset();
	}
	
	function onblurdo(obj)
	{
		if(obj.value == '' )
		{
			obj.style.backgroundColor="#ffaa44";
		}else
		{
			obj.style.backgroundColor="#ffffff";
		}
	}
	function clicksubmit()
	{
		var tempform = document.registerForm;
		
		if(tempform.contactname.value == '' )
		{
			tempform.contactname.style.backgroundColor="#ffaa44";
			return;
		}else if(!isTel(tempform.phone1.value))
		{
			if(tempform.phone1.value.length > 16 || tempform.phone1.value.length > 0)
				alert("请输入正确的电话号码，或者你的电话超长了!");
		 	return false;
		}else if(tempform.email.value == '' || !isEmail(tempform.email.value))
		{
			tempform.email.style.backgroundColor="#ffaa44";
			return false;
		}
		document.registerForm.submit();
	}
	
	function isTel(s)
		{
		//var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/;
		if(s==""){
			alert('电话不能为空！');
	        return false;
		}
		var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
		if (!patrn.exec(s)) return false
		return true
		}
		
  function IsURL(str_url){
   str_url=str_url.toLowerCase();
  var strRegex = "^((https|http|ftp|rtsp|mms)?://)"
  + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@
        + "(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184
        + "|" // 允许IP和DOMAIN（域名）
        + "([0-9a-z_!~*'()-]+\.)*" // 域名- www.
        + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." // 二级域名
        + "[a-z]{2,6})" // first level domain- .com or .museum
        + "(:[0-9]{1,4})?" // 端口- :80
        + "((/?)|" // a slash isn't required if there is no file name
        + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
        var re=new RegExp(strRegex);

        if (re.test(str_url)){
            return true;
        }else{
            return false;
        }
    } 
    
    function isEmail(email){
    var myreg = /^([a-zA-Z0-9]+[_|\_|\.-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.-]?)*[a-zA-Z0-9]?\.[a-zA-Z]{2,6}$/;
    
    	if(!myreg.test(email))
        {
               alert('请输入有效的邮箱！');
               return false;
         }else{
         
         	return true;
         }
    
    }
    



	
</script>